﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Irony.Parsing;

namespace NMF.Languages.AnyText
{
    public class IdentifierReference : TypedNonTerminal
    {
        public IdentifierReference(string name, IdentifierTerminal baseTerminal)
            : base(name)
        {
            this.Rule = baseTerminal;
        }

        public bool MustExist { get; set; }

        public Identifier Identifier { get; set; }

        public override TypeReference Type
        {
            get
            {
                if (Identifier == null) return null;
                return Identifier.IdentifiedClass;
            }
        }
    }
}
